package com.infomanage.bean;

import java.util.ArrayList;
import java.util.List;

import com.infomanage.authority.AuthorityBean;

public class SearchBean {

	private List<FieldBean> fields = new ArrayList<FieldBean>();
	private PaginationBean page = null;
	private AuthorityBean authority = null;
	private String beginTimeName = null;
	private String endTimeName = null;
	private String beginTimeValue = null;
	private String endTimeValue = null;
	public PaginationBean getPage() {
		return page;
	}

	public String getBeginTimeName() {
		return beginTimeName;
	}

	public void setBeginTimeName(String beginTimeName) {
		this.beginTimeName = beginTimeName;
	}

	public String getEndTimeName() {
		return endTimeName;
	}

	public void setEndTimeName(String endTimeName) {
		this.endTimeName = endTimeName;
	}

	public void setPage(PaginationBean page) {
		this.page = page;
	}

	public void add(FieldBean field) {
		fields.add(field);
	}

	public int size() {
		return fields.size();
	}

	public String getBeginTimeValue() {
		return beginTimeValue;
	}

	public void setBeginTimeValue(String beginTimeValue) {
		this.beginTimeValue = beginTimeValue;
	}

	public String getEndTimeValue() {
		return endTimeValue;
	}

	public void setEndTimeValue(String endTimeValue) {
		this.endTimeValue = endTimeValue;
	}

	public FieldBean[] getFields() {
		return fields.toArray(new FieldBean[fields.size()]);
	}

	public FieldBean get(String fieldName) {
		for (FieldBean field : fields) {
			if (field.getName().equals(fieldName)) {
				return field;
			}
		}
		return null;
	}

	public AuthorityBean getAuthority() {
		return authority;
	}

	public void setAuthority(AuthorityBean authority) {
		this.authority = authority;
	}
}
